package com.asset.vo;

import java.util.HashMap;
import java.util.Map;

/**
 * 创建的返回类型，页面可以根据此数据判断显示类型
 *
 * */
public class AjaxJson {
    private String success = "true";
    private String code = "200";
    private String msg = "操作成功";
    private Map<String, Object> data= new HashMap<String, Object>();
    public AjaxJson() {}

    public String getSuccess() {
        return success;
    }

    public void setSuccess(String success) {
        if ("true".equals(success)) {
            this.success = "true";
        } else if ("false".equals(success)) {
            this.success = "false";
            this.code = "500";
        }
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Map<String, Object> getData() {
        return data;
    }

    public void setData(Map<String, Object> data) {
        this.data = data;
    }

    public void putData(String key, Object value) {
        data.put(key, value);
    }
}
